# antispam
function chk_antispam ($m, $nopictures = false) {
global $allgAr;
if ($nopictures) {
return (bool) (isset($_POST['antispam_id']) and isset($_SESSION['antispam'][$_POST['antispam_id']]));
}
if (is_numeric($allgAr['antispam']) AND has_right($allgAr['antispam'])) {
return true;
}
if (isset($_POST['antispam']) AND isset($_POST['antispam_id']) AND isset($_SESSION['antispam'][$_POST['antispam_id']]) AND $_POST['antispam'] == $_SESSION['antispam'][$_POST['antispam_id']][$m][3]) {
unset ($_SESSION['antispam'][$_POST['antispam_id']]);
return (true);
}
return (false);
}
function get_antispam ($m, $t, $nopictures = false) {
global $allgAr, $antispamId;
mt_srand((double)microtime()*1000000);
$i1 = mt_rand (1,9);
$i2 = mt_rand (1,9);
$i3 = mt_rand (1,9);
if (isset($antispamId)) {
$id = $antispamId;
} else {
$id = $antispamId = uniqid($m, true);
}
$rs = '<input type="hidden" name="antispam_id" value="'.$id.'" />';
if ($nopictures) {
$_SESSION['antispam'][$id] = true;
return $rs;
}
if (is_numeric($allgAr['antispam']) and has_right($allgAr['antispam'])) {
return '';
}
if (!isset($_SESSION['antispam']) or (isset($_SESSION['antispam']) and !is_array($_SESSION['antispam']))) {
$_SESSION['antispam'] = array();
}
$_SESSION['antispam'][$m] = array();
$i1 = mt_rand (1,9);
$i2 = mt_rand (1,9);
$i3 = mt_rand (1,9);
$_SESSION['antispam'][$id][$m] = array($i1, $i2, $i3, $i1.$i2.$i3);
$rs .= '<span style="display: inline; width: 100px; vertical-align: middle; text-align: center; background-color: #000000; border: 0px; padding: 2px; margin: 0px;">'.
'<img src="include/images/spam/z.php?m='.$m.'&w=0&'.session_name().'='.session_id().'&id='.$id.'" alt="">'.
'<img src="include/images/spam/z.php?m='.$m.'&w=1&'.session_name().'='.session_id().'&id='.$id.'" alt="">'.
'<img src="include/images/spam/z.php?m='.$m.'&w=2&'.session_name().'='.session_id().'&id='.$id.'" alt="">'.
'<input name="antispam" size="3" maxlength="3" style="background-color: #FFFFFF; border: 0px; margin: 0px; padding: 0px;" /></span>';
if ($t == 0) {
return ($rs);
} elseif ($t == 1) {
return ('<tr><td class="Cmite">Antispam</td><td class="Cnorm">'.$rs.'</td></tr>');
} elseif ($t > 10) {
return ('<label style="float:left; width: '.$t.'px; ">Antispam</label>'.$rs.'<br />');
} else {
return ('');
}
}
# antispam
# antispam
function chk_antispam ($m=false, $nopictures = false) {
global $allgAr;
require_once('include/includes/func/recaptchalib.php');
if ( is_bool($_SESSION['recaptcha']) ) {
$recaptcha = $_SESSION['recaptcha'];
} else {
$recaptcha = false;
}
if ( is_bool($_SESSION['allg_antispam']) ) {
$allg_antispam = $_SESSION['allg_antispam'];
} else {
$allg_antispam = true;
if ( is_bool($_SESSION['antispam_right']) ) {
$allg_antispam = $_SESSION['antispam_right'];
}
}
if ((is_numeric($allgAr['antispam']) and has_right($allgAr['antispam']) && $allg_antispam === true) || ( is_numeric( $allg_antispam ) && has_right($allg_antispam) ) ) {
return true;
}
if ( ( $allgAr['recaptcha'] == 1 || $recaptcha === true ) && !empty($allgAr['recaptcha_public_key']) && !empty($allgAr['recaptcha_private_key']) ) {
$privatekey = $allgAr['recaptcha_private_key'];
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
return false;
} else {
return true;
}
} else {
if ($nopictures) {
return (bool) (isset($_POST['antispam_id']) and isset($_SESSION['antispam'][$_POST['antispam_id']]));
}
if (is_numeric($allgAr['antispam']) AND has_right($allgAr['antispam'])) {
return true;
}
if (isset($_POST['antispam']) AND isset($_POST['antispam_id']) AND isset($_SESSION['antispam'][$_POST['antispam_id']]) AND $_POST['antispam'] == $_SESSION['antispam'][$_POST['antispam_id']][$m][3]) {
unset ($_SESSION['antispam'][$_POST['antispam_id']]);
return (true);
}
return (false);
}
}
function get_antispam ($m=false, $t=false, $nopictures = false, $recaptcha = true, $allg_antispam = true) {
global $allgAr, $antispamId;
require_once('include/includes/func/recaptchalib.php');
$_SESSION['allg_antispam'] = ( is_bool($allg_antispam) ? $allg_antispam : true );
if ( is_numeric( $allg_antispam ) ) {
$_SESSION['antispam_right'] = $allg_antispam;
}
$_SESSION['recaptcha'] = ( is_bool($recaptcha) ? $recaptcha : false );
if ( ( is_numeric($allgAr['antispam']) and has_right($allgAr['antispam']) && $allg_antispam === false ) || ( is_numeric( $allg_antispam ) && has_right($allg_antispam) ) ) {
return '';
}
if ( ( $allgAr['recaptcha'] == 1 || $recaptcha === true ) && !empty($allgAr['recaptcha_public_key']) && !empty($allgAr['recaptcha_private_key']) ) {
$publickey = $allgAr['recaptcha_public_key']; // you got this from the signup page
$_SESSION['recaptcha'] = true;
$field = recaptcha_get_html($publickey);
if ($t == 0) {
return $field;
} elseif ($t == 1) {
return ('<tr><td class="Cmite">Antispam</td><td class="Cnorm">'.$field.'</td></tr>');
} elseif ($t > 10) {
return ('<label style="float:left; width: '.$t.'px; ">Antispam</label>'.$field.'<br />');
} else {
return ('');
}
} else {
mt_srand((double)microtime()*1000000);
$i1 = mt_rand (1,9);
$i2 = mt_rand (1,9);
$i3 = mt_rand (1,9);
if (isset($antispamId)) {
$id = $antispamId;
} else {
$id = $antispamId = uniqid($m, true);
}
$rs = '<input type="hidden" name="antispam_id" value="'.$id.'" />';
if ($nopictures) {
$_SESSION['antispam'][$id] = true;
return $rs;
}
if (is_numeric($allgAr['antispam']) and has_right($allgAr['antispam'])) {
return '';
}
if (!isset($_SESSION['antispam']) or (isset($_SESSION['antispam']) and !is_array($_SESSION['antispam']))) {
$_SESSION['antispam'] = array();
}
$_SESSION['antispam'][$m] = array();
$i1 = mt_rand (1,9);
$i2 = mt_rand (1,9);
$i3 = mt_rand (1,9);
$_SESSION['antispam'][$id][$m] = array($i1, $i2, $i3, $i1.$i2.$i3);
$rs .= '<span style="display: inline; width: 100px; vertical-align: middle; text-align: center; background-color: #000000; border: 0px; padding: 2px; margin: 0px;">'.
'<img src="include/images/spam/z.php?m='.$m.'&w=0&'.session_name().'='.session_id().'&id='.$id.'" alt="">'.
'<img src="include/images/spam/z.php?m='.$m.'&w=1&'.session_name().'='.session_id().'&id='.$id.'" alt="">'.
'<img src="include/images/spam/z.php?m='.$m.'&w=2&'.session_name().'='.session_id().'&id='.$id.'" alt="">'.
'<input name="antispam" size="3" maxlength="3" style="background-color: #FFFFFF; border: 0px; margin: 0px; padding: 0px;" /></span>';
if ($t == 0) {
return ($rs);
} elseif ($t == 1) {
return ('<tr><td class="Cmite">Antispam</td><td class="Cnorm">'.$rs.'</td></tr>');
} elseif ($t > 10) {
return ('<label style="float:left; width: '.$t.'px; ">Antispam</label>'.$rs.'<br />');
} else {
return ('');
}
}
}
# antispam